package com.humanmonth.home.component.page.report.remote
{
	import com.humanmonth.global.Config;
	
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	import mx.core.Application;
	import mx.managers.CursorManager;
	
	public class Connector
	{
		public function Connector()
		{
		}
		/**
		 * @param func 回调方法
		 * 向服务端获取数据 
		 */
		public function getTreeData() : void {
			CursorManager.setBusyCursor();
			new URLLoader(new URLRequest(Config.link+"/home/tree_role.xml")).addEventListener(Event.COMPLETE, initData);
		}
		
		/**
		 * 初始化所有数据 
		 */
		private function initData(event : Event):void{
			new XmlToTree(XML(URLLoader(event.target).data)).myInit();
			Application.application.report.dataBoard.updateDate();
			CursorManager.removeBusyCursor();		
		}

	}
}